package com.shop.shopserver.task;

import com.shop.shopserver.mapper.OrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class RegularDeliveryTask {
    @Autowired
    private OrderMapper orderMapper;
    // 每10秒执行一次
    @Scheduled(fixedRate = 10000)
    public void regularDelivery() {
        log.info("regularDelivery 执行中");
        orderMapper.orderDelivery();
    }
}
